﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="Scripts/jquery-1.10.2.min.js"></script>
    <link href="Content/Css/bootstrap.min.css" rel="stylesheet" />
    <link href="Content/Css/Site.css" rel="stylesheet" />
    <title>壹键通教育云盘服务平台</title>
    <script src="Scripts/WEB/WebJs.js"></script>
    <script>
        $(document).ready(function () {
            externalLogin();
          
        });
        function checkParames(param)
        {
            if (param != undefined && param != null && param != "")
                return true;
            else
                return false;
        }
        function externalLogin() {
            var url = "/Ajax/ToLoginUnpassWord";
            var usercode = getQueryString("Code");
            var userType = getQueryString("Type");
            var ts = getQueryString("ts");
            var userToken = getQueryString("userToken");
            if (checkParames(usercode) && checkParames(userType) && checkParames(ts) && checkParames(userToken)) {
                var par = { "userCode": usercode, "userType": userType, "ts": ts, "userToken": userToken };
                EDUCAjax(par, function () {
                    $('#login').html("登陆中...");
                }, function (re) {
                    $('#login').html("登陆");
                    if (undefined != re.ret && re.ret.length > 0) {
                        if ($.toString(re.ret[0]).indexOf("用户登录成功") > 0) {
                            window.location.href="/Manage/Index";
                        }
                        else {
                            $('.bg-danger .text-danger').html(re.ret[0]);
                            $('.bg-danger').show();
                        }
                    }
                    else {
                        $('.bg-danger .text-danger').html("网络异常,请重试!");
                        $('.bg-danger').show();
                    }
                }, url);
            }
            else {
                showErrorMsg("数据异常");
            }
           


        }
     
        function showErrorMsg(errormsg)
        {
            $('.bg-danger .text-danger').html(errormsg + ",3秒后自动跳转到登陆页面!");
            $('.bg-danger').show();
        
            var intervalid;
            intervalid = setInterval(function () {
                gotourl("/login.html");
                clearInterval(intervalid);
            }, 3000);

        }


    </script>

</head>
<body>
    <div style="padding-left: 15%; padding-right: 15%; ">
        <div class="text-center info-wrapper">
            <div class="bg-danger" style="display:none;">
                <span class="text-danger"></span>
            </div>
        </div>
    
       
    </div>
</body>
</html>
